package com.tianji.learning.controller;

import com.tianji.learning.domain.query.PointsBoardQuery;
import com.tianji.learning.domain.vo.PointsBoardSeasonVO;
import com.tianji.learning.domain.vo.PointsBoardVO;
import com.tianji.learning.service.IPointsBoardSeasonService;
import com.tianji.learning.service.IPointsBoardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 学霸天梯榜 控制器
 * </p>
 *
 * @author xjs
 */
@Api(tags = "PointsBoard管理")
@RestController
@RequiredArgsConstructor
@RequestMapping("/boards")
public class PointsBoardController {

    private final IPointsBoardService pointsBoardService;
    private final IPointsBoardSeasonService seasonService;

    @GetMapping
    public PointsBoardVO get(PointsBoardQuery pageQuery){
        return pointsBoardService.getBoard(pageQuery);
    }

    @ApiOperation("获取赛季列表")
    @GetMapping("/seasons/list")
    public List<PointsBoardSeasonVO> seasonsList(){
        return seasonService.seasonsList();
    }

}
